package com.woniuxy.riskmanage.service.impl;


import com.woniuxy.commons.entity.RuleLog;
import com.woniuxy.riskmanage.mapper.LogMapper;
import com.woniuxy.riskmanage.service.LogService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author author
 * @create 2021-11-17 11:27
 */
@Service
public class LogServiceImpl implements LogService {

    @Resource
private LogMapper logMapper;


    @Override
    public List<RuleLog> getall(Integer pageIndex, Integer pageSize) {
        Pageable pageable= PageRequest.of(pageIndex, pageSize);
        Page<RuleLog> all = logMapper.findAll(pageable);
        List<RuleLog> ruleLogs = all.getContent();
        return ruleLogs;
    }
}
